<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text" value="狄安娜">
    <script>
        // 1.获取表单元素
        const uname = document.querySelector(`input`)
        //2.修改标签属性（文本）之前的是用innerHTML
        uname.value = '困困'
        //修改表单类型
        uname.type = 'password'
    </script>
</body>

</html>